﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CourseChoosing.aspx.cs" Inherits="CourseChoosing" EnableEventValidation="false" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
         <link rel="stylesheet" type="text/css" href="css/Student.css"/>
</head>
<body>
    <form id="form1" runat="server" >
        <div id="gvCourseChoosing">
            <div>
                <div id="header" style="background-color: #4D8AB3;">
                    <asp:Button ID="btnStudent" runat="server" Text="学生" OnClick="btnStudent_Click" title="返回上级"/>

                    <asp:Button ID="btnChange" runat="server" Text="修改密码" OnClick="btnChange_Click" />

                </div>
                <div style="text-align: center; height:120px; width: 100%">
    
                      <asp:ImageButton ID="Image2" runat="server" Height="100px" ImageAlign="Left" ImageUrl="~/images/校标.png" Width="100px" OnClick="Image2_Click" alt="返回课程页面" title="返回课程页面"/>
                      <p id="name">学生成绩管理系统-学生选课</p>

                </div>
            </div>
            <div id="choose">
            开课单位：<asp:DropDownList ID="ddlCollege" runat="server" DataSourceID="SqlDataSource2" DataTextField="name" DataValueField="name">
            </asp:DropDownList>
            <asp:Button ID="btnQuery" runat="server" Text="查询" OnClick="btnQuery_Click" />
            <br />
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:performanceConnectionString %>" SelectCommand="SELECT [name] FROM [college]"></asp:SqlDataSource>
            <asp:Label ID="lblAllCourse" runat="server" Font-Bold="True" Text="所有课程："></asp:Label>
            <br />
            <asp:GridView ID="gvCoursechoosing" runat="server" AutoGenerateColumns="False" DataKeyNames="id" OnRowDataBound="gvCoursechoosing_RowDataBound" OnSelectedIndexChanging="gvCoursechoosing_SelectedIndexChanging1" CellPadding="4" ForeColor="#333333" GridLines="None" >
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:CommandField SelectText="选课" ShowSelectButton="True" />
                    <asp:HyperLinkField DataNavigateUrlFields="id" DataNavigateUrlFormatString="CourseDetails.aspx?id={0}" Text="详细" />
                    <asp:BoundField DataField="id" HeaderText="课程号" ReadOnly="True" SortExpression="id" />
                    <asp:BoundField DataField="name" HeaderText="课程名" SortExpression="name" />
                    <asp:BoundField DataField="credit" HeaderText="学分" SortExpression="credit" />
                    <asp:BoundField DataField="college" HeaderText="学院" SortExpression="college" />
                    <asp:BoundField DataField="teacher_name" HeaderText="任课教师" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            <asp:Label ID="lblCourseChoosing" runat="server" Font-Bold="True" Font-Size="Larger" ForeColor="Red"></asp:Label>
            <br />
            <asp:Label ID="lblSelectedCourse" runat="server" Font-Bold="True" Text="已选课程："></asp:Label>
            <br />
            <asp:GridView ID="gvSelectedCourse" runat="server" AutoGenerateColumns="False" DataKeyNames="id" OnRowDataBound="gvSelectedCourse_RowDataBound" OnRowDeleting="gvSelectedCourse_RowDeleting" CellPadding="4" ForeColor="#333333" GridLines="None">
                <AlternatingRowStyle BackColor="White" />
                <Columns>
                    <asp:CommandField ShowDeleteButton="True" />
                    <asp:BoundField DataField="id" HeaderText="学号" SortExpression="id" />
                    <asp:BoundField DataField="name" HeaderText="姓名" />
                    <asp:BoundField DataField="course_id" HeaderText="课程号" />
                    <asp:BoundField DataField="course_name" HeaderText="课程名" />
                    <asp:BoundField DataField="credit" HeaderText="学分" />
                    <asp:BoundField DataField="teacher_name" HeaderText="任课教师" />
                </Columns>
                <EditRowStyle BackColor="#2461BF" />
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#EFF3FB" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                <SortedDescendingHeaderStyle BackColor="#4870BE" />
            </asp:GridView>
            </div>
        </div>
    </form>
    <div id="footer" style="clear: both;position:absolute; bottom: 0px">
    </div>
</body>
</html>
